import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Button

# 打印所有可用的主题
print(plt.style.available)

# 初始化数据
x = np.linspace(0, 1, 400)
y_square = x**2
y_square_square = y_square**2

# 创建图形
fig, ax = plt.subplots(figsize=(10, 6))

# 绘制不同的函数
line1, = ax.plot(x, x, label="y = x (Linear Function)", linestyle='--')
line2, = ax.plot(x, y_square, label="y = x^2 (Square Function)")
line3, = ax.plot(x, y_square_square, label="y = (x^2)^2 (Square of Square Function)", linestyle='dotted')

# 设置图形标签
ax.set_title('Comparison of Linear, Square Function and Square of Square Function')
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.legend()
ax.grid(True)

# 显示图形
plt.show()
